import pymysql

# 定义变量，创建连接
conn = pymysql.connect(host="211.103.136.244", port=7068, user="student", password="KDTX_student_202304",
                       database="huike", charset="utf8")
# 定义变量，创建游标
cursor = conn.cursor()
# 执行sql语句
sql = "select version()"
cursor.execute(sql)
# 获取查询的结果，并打印
print(cursor.fetchone()[0])
# 关闭游标
cursor.close()
# 关闭数据库连接
conn.close()

# sql = "select name from tb_course where name='接口测试001'"
# cursor.execute(sql)
# return cursor.fetchone()
# assert response.json().get(”name“) == cursor.fetchone()[0]